package com.sjsu.aws.groupmembership;

/**
 * 
 * @author Deepali Pawar
 *
 */
import java.util.List;
import java.util.Map;
import com.amazonaws.services.dynamodb.model.AttributeValue;

public interface GroupMembershipService {
	/**
	 * 
	 * @param g
	 * @return
	 * @throws Exception
	 */
	public Map<String, AttributeValue> createGroupMemberShipItem(
	        GroupMemberShip g) throws Exception;
	
	/**
	 * Implementation includes join member to group  
	 * @param g
	 * @throws Exception
	 */
	public void joinGroup(GroupMemberShip g) throws Exception;
	
	/**
	 * Implementation includes disjoin member from group
	 * @param g
	 * @throws Exception
	 */
	public void disjoinGroup(GroupMemberShip g) throws Exception;
	
	/**
	 * Implementation includes delete member from group
	 * @param gm
	 * @throws Exception
	 */
	public void deleteGroup(GroupMemberShip gm) throws Exception;
	
	/**
	 * Implementation includes list members from group
	 * @return
	 * @throws Exception
	 */
	public List<GroupMemberShip> listGroupMembers() throws Exception;
	
	/**
	 * Implementation includes new membership 
	 * @param gm
	 * @throws Exception
	 */
	public void renewEphemeralMembership(GroupMemberShip gm) throws Exception;
	
	/**
	 * 
	 * @throws Exception
	 */
	public void deleteTimeOutSessionsForEphemeralNode() throws Exception;
	
	/**
	 * 
	 * @throws Exception
	 */
	public void deleteEphemeralNodesOnDisconnect() throws Exception;
	
}
